//#define  _CRT_SECURE_NO_WARNINGS 1
//#include <stdio.h>
//#include <string.h>
////int cmp_int(const void* p1, const void* p2) {
////	//return *(int*)p1 - *(int*)p2;
////	return *(int*)p2 - *(int*)p1 ;
////}
//
////int main() {
////	int arr[] = { 6, 3, 9, 8, 5, 2, 4, 7, 1, 0 };
////	int sz = sizeof(arr) / sizeof(arr[0]);
////	qsort(arr, sz, 4, cmp_int);
////	for (int i = 0; i < 10; i++) {
////		printf("%d ", arr[i]);
////	}
////	return 0;
////}
//
//
////struct Stu {
////	char name[20];
////	int age;
////};
////int cmp_struct_name(const void*p1,const void*p2){
////	//return  strcmp((*(struct Stu*)p1).name, (*(struct Stu*)p2).name);
////	return  strcmp(((struct Stu*)p1)->name, ((struct Stu*)p2)->name);
////}
////
////int cmp_struct_age(const void* p1, const void* p2) {
////	return ((struct Stu*)p1)->age - ((struct Stu*)p2)->age;
////}
////
////int main() {
////	struct Stu arr[3] = { {"bbb",70},{"ccc",18},{"aaa",10} };
////	int sz = sizeof(arr) / sizeof(arr[0]);
////	qsort(arr, sz, sizeof(arr[0]), cmp_struct_age);
////	for (int i = 0; i < 3; i++) {
////		printf("%s ", arr[i].name);
////	}
////	return 0;
////}
////int main() {
////
////	return 0;
////}
//
//// int cmp_int(const void* p1, const void* p2) {
////	return *(int*)p1 - *(int*)p2;
////	//return *(int*)p2 - *(int*)p1 ;
////}
////
//// void my_swap(char* p1,char* p2,size_t n) {
////	 for (int i = 0; i < n; i++) {
////		 char tem = *p1;
////		 *p1 = *p2;
////		 *p2 = tem;
////		 p1++;
////		 p2++;
////	 }
//// }
//
// /*void bubble_qsort(void * base,size_t sz,size_t width,int(*cmp)(const void *,const void *)) {
//	 for (int i = 0; i < sz - 1; i++) {
//		 for (int j = 0; j < sz - 1; j++) {
//			 if (cmp(((char*)base + j * width), ((char*)base + (j+1)*width)) > 0) {
//				 my_swap(((char*)base + j * width), ((char*)base + (j + 1) * width),width);
//			 }
//		 }
//	 }
//
// }
//int main() {
//	int arr[] = { 6, 3, 9, 8, 5, 2, 4, 7, 1, 0 };
//	int sz = sizeof(arr) / sizeof(arr[0]);
//	bubble_qsort(arr, sz, 4, cmp_int);
//	for (int i = 0; i < 10; i++) {
//		printf("%d ", arr[i]);
//	}
//	return 0;
//}*/
//
//
//
////void my_swap(char* p1, char* p2, size_t n) {
////	for (int i = 0; i < n; i++) {
////		char tem = *p1;
////		*p1 = *p2;
////		*p2 = tem;
////		p1++;
////		p2++;
////	}
////}
////
////void bubble_qsort(void* base, size_t sz, size_t width, int(*cmp)(const void*, const void*)) {
////	for (int i = 0; i < sz - 1; i++) {
////		for (int j = 0; j < sz - 1; j++) {
////			if (cmp(((char*)base + j * width), ((char*)base + (j + 1) * width)) > 0) {
////				my_swap(((char*)base + j * width), ((char*)base + (j + 1) * width), width);
////			}
////		}
////	}
////
////}
////struct stu {
////	char name[20];
////	int age;
////};
////int cmp_struct_name(const void*p1,const void*p2){
////	//return  strcmp((*(struct stu*)p1).name, (*(struct stu*)p2).name);
////	return  strcmp(((struct stu*)p1)->name, ((struct stu*)p2)->name);
////}
////int main() {
////	struct stu arr[3] = { {"bbb",70},{"ccc",18},{"aaa",10} };
////	int sz = sizeof(arr) / sizeof(arr[0]);
////	bubble_qsort(arr, sz, sizeof(arr[0]), cmp_struct_name);
////	for (int i = 0; i < 3; i++) {
////		printf("%s ", arr[i].name);
////	}
////	return 0;
////}
